package cn.iocoder.yudao.module.product.api.conveniencestore;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.product.api.conveniencestore.dto.ProductConvenienceStoreRespDTO;
import cn.iocoder.yudao.module.product.dal.dataobject.conveniencestore.ConvenienceStoreDO;
import cn.iocoder.yudao.module.product.service.conveniencestore.ConvenienceStoreService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品评论 API 实现类
 *
 * @author HUIHUI
 */
@Service
@Validated
public class ProductConvenienceStoreApiImpl implements ProductConvenienceStoreApi {

    @Resource
    private ConvenienceStoreService convenienceStoreService;

    @Override
    public List<Long> getMyConvenienceStoreIdList(Long userId) {
        return convenienceStoreService.getMyConvenienceStoreIdList(userId);
    }

    @Override
    public String getDoorHeaderImage(Long shopId) {
        return convenienceStoreService.getDoorHeaderImage(shopId);
    }

    @Override
    public ProductConvenienceStoreRespDTO getProductConvenienceStore(Long shopId) {
        ConvenienceStoreDO convenienceStoreDO = convenienceStoreService.getConvenienceStore(shopId);
        return BeanUtils.toBean(convenienceStoreDO, ProductConvenienceStoreRespDTO.class);
    }
}
